package com.netbetter.langzheng.plugin.fileManager.dto;

import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.netbetter.langzheng.plugin.fileManager.contents.CommandEnums;
import com.netbetter.langzheng.plugin.fileManager.model.FileModel;

/**
 * @author 嘉陵江里捉鱼 email:tang7259@163.com
 *@version 1.0
 *@time 2008-9-16 下午08:18:04
 */
public class CommandDTO {

    CommandEnums type;
    FileModel    fileModel;

    public CommandEnums getType() {
        return type;
    }

    public void setType(CommandEnums type) {
        this.type = type;
    }

    public FileModel getFileModel() {
        return fileModel;
    }

    public void setFileModel(FileModel fileModel) {
        this.fileModel = fileModel;
    }

    @Override
    public String toString() {
        JSONObject jsonObject = new JSONObject();
        JSONString jsonType = new JSONString(type.getValue());
        jsonObject.put("type", jsonType);
        jsonObject.put("fileModel", fileModel.getJSONObject());
        return jsonObject.toString();
    }

}
